import request from '@/utils/request'

// 查询企业的部门列表
export function getDepartments () {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}
// 根据ID删除部门
export function delDepartment (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

// 新增部门
export function addDepartment (data) {
  return request({
    url: `/company/department`,
    method: 'POST',
    data
  })
}

// 根据ID查询部门详情
export function getDepartDetail (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

// 根据ID修改部门详情
export function updateDepartDetail (data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
